package com.zmn.oms.common.constant;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Objects;

/**
 * 类描述：订单
 *
 * 系统标签 小于1000，不要乱加
 *
 * @author wangxiaokun
 * @since 2021/06/28 11:15
 */
@Component
public class OrderTagConsts {

    /**
     * 高价值用户-用户层级一级分类
     */
    public final static Integer UUC_USER_TAG_CATEG_ONE_ID = 700;


    /**
     * 高价值用户标签id
     */
    public static Integer USER_TAG_ID_HIGH_VALUE = 2088;

    /**
     *  排除工程师绩效分类ID
     */
    public static Integer TAG_CATEGORY_ID_EXCLUDE_PERFORMANCE = 1001;


    @Value("${tag.id.high.value.user:2088}")
    public void setTagIdHighValueUser(Integer tagIdHighValueUser) {
        USER_TAG_ID_HIGH_VALUE = tagIdHighValueUser;
    }

    //--------------------------------------


    /**
     * 机器人
     */
    public static final int TAG_ID_BOT = 31;

    /**
     * 提前付
     */
    public static final int TAG_ID_ADVANCE_PAY = 32;


    /**
     * 订单标签
     */
    public final static int ORDER_TAG_USER_SYSTEM = 1; // 用户系统订单标签

    /**
     * 订单标签
     */
    public final static int ORDER_TAG_USER_STAFF = 10; // 用户员工订单标签


    // ********************* 工单属性-特殊标签 801~829 *********************
    // 会员单类型 Z+金卡
    public static final int TAG_ID_WORK_VAS_MEMBER_LEVEL_1 = 805;
    // 会员单类型 Z+钻卡
    public static final int TAG_ID_WORK_VAS_MEMBER_LEVEL_2 = 806;
    // 信息公司兜底
    public static final int TAG_ID_OCO_COMPANY = 807;

    // 挂起
    public static final int TAG_ID_WORK_SUSPEND = 811;
    // 预约失败
    public static final int TAG_ID_WORK_DUTY_FAILED = 812;
    // 返修派
    public static final int TAG_ID_WORK_REWORK_DEMAND = 813;
    // 测试单
    public static final int TAG_ID_WORK_TEST = 814;
    // 一口价
    public static final int TAG_ID_WORK_FINAL_PRICE = 815;
    // 计价器
    public static final int TAG_ID_WORK_QUOTATION = 816;
    // 增值订单
    public static final int TAG_ID_WORK_VAS = 817;
    // 要客
    public static final int TAG_ID_WORK_USER_VVIP = 818;
    // 三日退
    public static final int TAG_ID_WORK_ALLOW_REFUND = 819;
    // 高价值用户
    public static final int TAG_ID_HIGH_VALUE_USER = 820;
    // 多次上门
    public static final int TAG_ID_HIGH_MULTIPLE_VISIT = 821;
    // 提前付
    public static final int TAG_ID_WORK_ADVANCE_PAY = 822;
    // 计价器3.0
    public static final int TAG_ID_WORK_QUOTATION_THREE = 823;
    // 过保新单
    public static final int TAG_ID_NEW_ORDER_FOR_REPAIR = 1007;
    // 返修新单
    public static final int TAG_ID_NEW_ORDER_FOR_REWORK = 824;
    // 返修收费
    public static final int TAG_ID_WORK_REWORK_CHARGE = 825;
    // 重复
    public static final int TAG_ID_WORK_DUPLICATE = 826;
    // 在途重复
    public static final int TAG_ID_ON_SERVICE_DUPLICATE = 827;
    // 优质订单
    public static final int TAG_ID_HIGH_QUALITY = 828;
    // 无网格
    public static final int TAG_ID_NON_GRID = 829;
    // 取消新单
    public static final int TAG_ID_NEW_ORDER_FOR_CANCEL = 666;

    // ********************* 工单属性-特殊标签 830~859 *********************
    // 相似当日派
    public static final int TAG_ID_SIMILAR_TODAY_DISTRIBUTE= 830;
    // 服务完成审核
    public static final int TAG_ID_WORK_SERVICE_COMPLETE_REVIEW = 831;
    // 退款审核
    public static final int TAG_ID_WORK_REFUND_REVIEW = 832;
    // 支持原路退
    public static final int TAG_ID_WORK_SUPPORT_BACKTRACKING = 835;
    // 疫情无法服务标签-剔除工程师绩效
    public static final int TAG_ID_EPIDEMIC_UNSERVICEABLE_CANCEL = 836;

    // ********************* 工单审核-特殊标签 860~879 *********************
    // 计价器-有效使用
    public static final int TAG_ID_WORK_QUOTATION_VALID = 861;
    // 计价器3.0有效使用
    public static final int TAG_ID_WORK_QUOTATION_THREE_VALID = 862;
    // 计价器3.0成功单有效使用
    public static final int TAG_ID_WORK_QUOTATION_THREE_SUCCESS_VALID = 863;
    // 一口价有效使用
    public static final int TAG_ID_WORK_FINAL_PRICE_VALID = 866;

    // 无效联系
    public static final int TAG_ID_WORK_CONTACT_INVALID = 1016;
    // 有效联系
    public static final int TAG_ID_WORK_CONTACT_EFFECTIVE = 1017;

    // 无法承接线索
    public static final int TAG_ID_UN_AVAILABLE_SERVICE = 865;

    // ********************* 特殊标签 (调用其他系统获取) *********************
    // 投诉
    public static final int TAG_ID_COMPLAIN = 901;
    // 重点渠道
    public static final int TAG_ID_IMPORTANT_CHANNEL = 902;

    // 预警-联系超时
    public static final int TAG_ID_WARNING_CONTACT_TIMEOUT = 911;
    // 预警
    public static final int TAG_ID_WARNING = 920;
    // 预警-超时
    public static final int TAG_ID_WARNING_TIMEOUT = 921;
    // 预警-异常
    public static final int TAG_ID_WARNING_ABNORMAL = 923;

    // 5min内取消
    public static final int TAG_ID_CANCEL_ORDER_WITHIN_5_MINUTES = 924;

    // 渠道评价
    public static final int TAG_ID_CHANNEL_INVITE = 925;

    // 退差额
    public static final int TAG_ID_ORDER_REFUND_DIFFERENCE = 926;

    // 未确认报价
    public static final int TAG_ID_QUOTE_UN_CONFIRMED = 999;

    // 竞争标签
    public static final int TAG_ID_WORK_COMPETITION = 1000;

    // 重复支付
    public static final int TAG_ID_DUPLICATE_PAY = 1003;

    // 质保金扣款成功
    public static final int TAG_ID_BONDPAY_SUCCESS = 1039;

    // 质保金扣款失败
    public static final int TAG_ID_BONDPAY_FAILED = 1040;

    /**
     * 获取标签名称
     * @param id
     * @return
     */
    public static final String getTagName(Integer id) {
        if (Objects.isNull(id)) {
            return "未知";
        }
        switch (id) {
            case TAG_ID_CHANNEL_INVITE:
                return "渠道评价";
            case TAG_ID_WORK_SUSPEND:
                return "挂起";
            case TAG_ID_OCO_COMPANY:
                return "信息公司兜底";
            case TAG_ID_WORK_DUTY_FAILED:
                return "预约失败";
            case TAG_ID_WORK_REWORK_DEMAND:
                return "返修派";
            case TAG_ID_WORK_TEST:
                return "测试单";
            case TAG_ID_WORK_FINAL_PRICE:
                return "一口价";
            case TAG_ID_WORK_FINAL_PRICE_VALID:
                return "一口价有效使用";
            case TAG_ID_WORK_QUOTATION:
                return "计价器";
            case TAG_ID_WORK_ADVANCE_PAY:
                return "提前付";
            case TAG_ID_WORK_QUOTATION_THREE:
                return "新计价器";
            case TAG_ID_WORK_VAS:
                return "增值订单";
            case TAG_ID_WORK_USER_VVIP:
                return "要客";
            case TAG_ID_WORK_ALLOW_REFUND:
                return "三日退";
            case TAG_ID_HIGH_VALUE_USER:
                return "高价值用户";
            case TAG_ID_HIGH_MULTIPLE_VISIT:
                return "多次收款";
            case TAG_ID_WORK_SERVICE_COMPLETE_REVIEW:
                return "服务完成审核";
            case TAG_ID_WORK_REFUND_REVIEW:
                return "退款审核";
            case TAG_ID_WORK_QUOTATION_VALID:
                return "计价器-有效使用";
            case TAG_ID_WORK_QUOTATION_THREE_VALID:
                return "计价器3.0有效使用";
            case TAG_ID_WORK_QUOTATION_THREE_SUCCESS_VALID:
                return "计价器3.0成功单有效使用";
            case TAG_ID_NEW_ORDER_FOR_REWORK:
                return "返修新单";
            case TAG_ID_WORK_REWORK_CHARGE:
                return "返修收费";
            case TAG_ID_WORK_DUPLICATE:
                return "重复单";
            case TAG_ID_UN_AVAILABLE_SERVICE:
                return "未成单";
            case TAG_ID_COMPLAIN:
                return "投诉";
            case TAG_ID_IMPORTANT_CHANNEL:
                return "重点渠道";
            case TAG_ID_WARNING:
                return "预警";
            case TAG_ID_WARNING_TIMEOUT:
                return "预警-超时";
            case TAG_ID_WARNING_ABNORMAL:
                return "预警-异常";
            case TAG_ID_CANCEL_ORDER_WITHIN_5_MINUTES:
                return "5min内取消";
            case TAG_ID_DUPLICATE_PAY:
                return "重复支付";
            case TAG_ID_ON_SERVICE_DUPLICATE:
                return "在途重复";
            case TAG_ID_HIGH_QUALITY:
                return "优质订单";
            case TAG_ID_NON_GRID:
                return "无网格";
            case TAG_ID_SIMILAR_TODAY_DISTRIBUTE:
                return "相似当日派";
            case TAG_ID_EPIDEMIC_UNSERVICEABLE_CANCEL:
                return "疫情无法服务";
            case TAG_ID_QUOTE_UN_CONFIRMED:
                return "报价未确认";
            case TAG_ID_BONDPAY_SUCCESS:
                return "质保金扣款成功";
            case TAG_ID_BONDPAY_FAILED:
                return "质保金扣款失败";
            default:
                return "未知";
        }
    }

}
